<template>
  <Layout>
    <NavBar :isShowLeftIcon="false" :iconName="``" :navTitle="`标签列表`"/>
    <div class="tags">
      <router-link :key="tag.id" :to="`/labels/edit/${tag.id}`" class="tag"
                   v-for="tag in tags">
        <span>{{ tag.name }}</span>
        <Icon name="right"/>
      </router-link>
    </div>
    <div class="createTag-wrapper">
      <Button @click="createTag" class="createTag">新建标签</Button>
    </div>
  </Layout>
</template>

<script lang="ts">
import {Component} from 'vue-property-decorator';
import Button from '@/components/Common/Button.vue';
import {mixins} from 'vue-class-component';
import TagHelper from '@/mixins/TagHelper';

@Component({
  components: {Button}
})
export default class Labels extends mixins(TagHelper) {

}
</script>

<style lang="scss" scoped>
.tags {
  font-size: 16px;
  background-color: white;
  padding-left: 16px;

  > .tag {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e6e6e6;

    svg {
      width: 18px;
      height: 18px;
      color: #666;
      margin-right: 16px;
    }
  }
}

.createTag-wrapper {
  position: fixed;
  bottom: 10vh;
  left: 50%;
  margin-left: -48px;
}

.createTag {
  &-wrapper {
    text-align: center;
    padding: 16px;
    margin-top: 44-16px;
    opacity: 0.6;
  }
}
</style>
